﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DynaPrecision.Financial
{
	public class CallBoundaryAndInitialValue : IInitialAndBoundaryValueProvider
	{

		public double LowerBoundValue(double Price, double Time)
		{
			return 0;
		}

		public double UpperBoundValue(double Price, double Time)
		{
			return Math.Max(Price - DataHolder.StrikePrice * Math.Exp(-DataHolder.RiskFreeInterestRate * (DataHolder.Expiration - Time)), 0);
		}

		public double Payoff(double Price, double Time)
		{
			return Math.Max(Price - DataHolder.StrikePrice, 0);
		}
		public OptionPricingDataHolder DataHolder
		{
			get;
			set;
		}
	}
}
